﻿@using System.Web.Optimization
@model dynamic
@{
    Layout = null;
}


<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>雪绒花_首页</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="keywords" content="" />
    <meta name="description" content="" />

    @Styles.Render("~/Themes/default/css/cp.globle.min6.css")
    @Scripts.Render("~/Themes/default/js/cp.globle.min6.js")
    <script type="text/javascript">
        //全局变量
        var pregnanterinfo_grid;

        $(function() {

            //初始化表格
            InitPregnanterInfoGrid();
        });


        function  InitPregnanterInfoGrid() {
            pregnanterinfo_grid = $("#pregnanterinfo_grid_data").bootgrid({
                ajax: true,
                post: function() {
                     return {
                         searchType: 2//1 数值 2 搜索条件
                    };
                //},
                url: "/api/PregnanterInfoApi/GetBootGridPregnanterInfos",
                selection: true,
                multiSelect: true,
                rowSelect: false,
                keepSelection: true,
                rowCount: [10, 30, 50],
                templates: {
                    header: "<div id=\"{{ctx.id}}\" class=\"{{css.header}}\"><div class=\"row\"><div class=\"col-sm-12 actionBar\"><div class=\"btn-group\" style=\"float:left;\"><button class=\"btn btn-default tip\" title=\"添加\" onclick=\"return pregnanterinfo_add(); \"><span class=\"glyphicon glyphicon-plus\"></span>添加</button><button class=\"btn btn-default tip\" title=\"批量删除\" onclick=\"return pregnanterinfo_multi_delete(); \"><span class=\"glyphicon glyphicon glyphicon glyphicon-trash\"></span>批量删除</button></div>" +
                        "<div class=\"search form-group\"><div class=\"input-group\"><span class=\"icon glyphicon input-group-addon glyphicon-search\"></span> <input type=\"text\" class=\"search-field form-control\" placeholder=\"输入关键字\"></div></div>" +
                        "<p class=\"{{css.actions}}\"></p></div></div></div>"
                },
                labels: {
                    all: "all", //checkbox全选的值
                    search: "请输入名称",
                    loading: "加载中...",
                    noResults: "对不起，暂无符合条件的记录！",
                    refresh: "刷新",
                    infos: "从{{ctx.start}} 到 {{ctx.end}}，共{{ctx.total}} 条记录"
                },
                formatters: {
                    "commands": function(column, row) {
                        return  "<button type=\"button\"  class=\"btn btn-link btn-sm btn-cmd tip\" onclick=\"return pregnanterinfo_edit(" + row.Id + ");\" title=\"修改【自定义】\"><span class=\"glyphicon glyphicon-pencil\"></span></button>" +
                            "<button type=\"button\"  class=\"btn btn-link btn-sm btn-cmd tip\" onclick=\"return pregnanterinfo_delete(" + row.Id + ");\" title=\"删除【自定义】\"><span class=\"glyphicon glyphicon-remove\"></span></button>";
                    }
                }
            }).on("loaded.rs.jquery.bootgrid", function(e) {
                //按钮提示
                $('.tip').tooltip({placement:"bottom"});
                //按钮气泡
                $('.pop').popover({ html: true, trigger: "hover" });
                //showMsg("数据加载完毕！", "Success");
            });
        }


        function pregnanterinfo_add() {
            showTopWindow("pregnanterinfo_show_add", "/Settings/PregnanterInfo/Edit?actionType=Add", null, 800, 400, function () {
                var pregnanterinfo_form = $(top.window.frames["frm_pregnanterinfo_show_add"].document).find("#pregnanterinfo_form");
                //console.log(pregnanterinfo_form);
                var flag = top.window.document.getElementById("frm_pregnanterinfo_show_add").contentWindow.form_valid();
                if (!flag) {
                    return false;
                }
                 var data = $(pregnanterinfo_form).serialize();
                //console.log((data));
                $.ajax({
                    type: "POST",
                    cache: false,
                    url: "/api/PregnanterInfoApi/AddPregnanterInfo",
                    data: data,
                    dataType: "json",
                    beforeSend: function() {
                       showTopDialog("show_add_loding", "<div class='dialog_loading'>添加中，请稍后...</div>", "温馨提示", 400, 95);
                    },
                    complete: function() {
                        //d.close().remove();
                    },
                    success: function(result) {
					    top.dialog.list["show_add_loding"].close().remove();
                        //toLowerCase报错
                        //var status = result.Status.toLowerCase();
                        var status = result.Status;
                        if (status == true || status == "true" || status == "True") {
                            //刷新数据
                            pregnanterinfo_grid.bootgrid("reload");
                            showMsg("添加成功！", "Success");
                        } else {
                            showMsg("系统异常，添加失败！", "Error");
                        }
                    },
                    error: function() {
					    top.dialog.list["show_edit_loding"].close().remove();
                        showMsg("网络连接错误！", "Error");
                    }
                });

            });
            //必须有这个，阻止刷新
            return false;
        }

        function pregnanterinfo_edit(id) {
             var url = "/Settings/PregnanterInfo/Edit?actionType=Edit&id=" + id;
            //console.log(id);
            showTopWindow("pregnanterinfo_show_edit", "修改信息", "title", 800, 400, function() {
                 var pregnanterinfo_form = $(top.window.frames["frm_pregnanterinfo_show_edit"].document).find("#pregnanterinfo_form");
                //console.log(pregnanterinfo_form);
                var flag = top.window.document.getElementById("frm_pregnanterinfo_show_edit").contentWindow.form_valid();
                if (!flag) {
                    return false;
                }
                 var data = $(pregnanterinfo_form).serialize();
                //console.log((data));
                
				 showTopConfirm("确认提交该记录吗？", "温馨提示", function() {
				$.ajax({
                    type: "POST",
                    cache: false,
                    url: "/api/PregnanterInfoApi/EditPregnanterInfo",
                    data: data,
                    dataType: "json",
                    beforeSend: function() {
                       showTopDialog("show_edit_loding", "<div class='dialog_loading'>修改中，请稍后...</div>", "温馨提示", 400, 95);
                    },
                    complete: function() {
                        //d.close().remove();
                    },
                    success: function(result) {
					top.dialog.list["show_edit_loding"].close().remove();
                        //toLowerCase报错
                        //var status = result.Status.toLowerCase();
                        var status = result.Status;
                        if (status == true || status == "true" || status == "True") {
                            //刷新数据
                            pregnanterinfo_grid.bootgrid("reload");
                            //console.log(grid);

                            showMsg("修改成功！", "Success");
                        } else {
                            showMsg("系统异常，修改失败！", "Error");
                        }
                    },
                    error: function() {
					    top.dialog.list["show_edit_loding"].close().remove();
                        showMsg("网络连接错误！", "Error");
                    }
                });

            },function() {
                //top.dialog.list["pregnanterinfo_show_edit"].close().remove();
            });
            return false;
        });

            //必须有这个，阻止刷新
            return false;
        }

		function pregnanterinfo_multi_delete() {
        var ids = get_selected_ids("pregnanterinfo_grid_data");
        //console.log(ids);
        if (ids == "") {
            showTopMsg("请选择你要删除的记录，删除后不可恢复！", "错误提示", "Error");
            return false;
        }
        //return false;
        pregnanterinfo_delete(ids);
         }

        function pregnanterinfo_delete(ids) {
            showTopDialog("pregnanterinfo_show_delete","<div class='dialog_confirm'>确认删除选中记录吗？删除后不可恢复！</div>","温馨提示",400, 75,function () {
                $.ajax({
                    type: "GET",
                    cache: false,
                    url:"/api/PregnanterInfoApi/DeletePregnanterInfo?ids="+ids,
                    dataType: "json",
                    beforeSend: function() {
                         showTopDialog("show_delete_loding", "<div class='dialog_loading'>删除中，请稍后...</div>", "温馨提示", 400, 95);
                    },
                    complete: function() {
                        //d.close().remove();
                    },
                    success: function(result) {
					    top.dialog.list["show_delete_loding"].close().remove();
                        //toLowerCase报错
                        //var status = result.Status.toLowerCase();
                        var status = result.Status;
                        if (status == true || status == "true" || status == "True") {
                            //刷新数据
                            pregnanterinfo_grid.bootgrid("reload");
                            showMsg("删除成功！", "Success");
                        } else {
                            showMsg("系统异常，删除失败！", "Error");
                        }
                    },
                    error: function() {
					    top.dialog.list["show_delete_loding"].close().remove();
                        showMsg("网络连接错误！", "Error");
                    }
                });
            });
            //必须有这个，阻止刷新
            return false;
        }


		//回收站
		         function clientinfo_trash() {
                var ids = get_selected_ids("clientinfo_grid_data");
                //console.log(ids);
                if (ids == "") {
                    showTopMsg("请选择你要删除的记录！", "错误提示", "Error");
                    return false;
                }
                //console.log(ids);
                //return false;
                showTopDialog("show_clientinfo_trash", "<div class='dialog_confirm'>确认将选中记录放入回收站吗？</div>", "温馨提示", 400, 75, function () {
                    $.ajax({
                        type: "GET",
                        cache: false,
                        url: "/api/ClientInfoApi/UpdateClientInfoStatus?ids=" + ids + "&status=1",
                        //data: { ids: ids },
                        dataType: "json",
                        beforeSend: function () {
                            //showMsg("添加中，请稍后...");
                        },
                        complete: function () {
                            //d.close().remove();
                        },
                        success: function (result) {
                            //toLowerCase报错
                            //var status = result.Status.toLowerCase();
                            var status = result.Status;
                            if (status == true || status == "true" || status == "True") {
                                //刷新数据
                                clientinfo_grid.bootgrid("reload");
                                showMsg("客户放入回收站成功！", "Success");
                            } else {
                                showMsg("系统异常，客户放入回收站失败！", "Error");
                            }
                        },
                        error: function () {
                            showTopMsg("网络连接错误!", "错误提示", "Error");
                        }
                    });
                });
                //必须有这个，阻止刷新
                return false;
            }
    </script>
 </head>
    <body>

<div style="margin: 0px 20px;">
    <table id="pregnanterinfo_grid_data" class="table table-condensed table-hover table-striped table-bordered" data-selection="true" data-multi-select="true">
        <thead>
            <tr>
	       		  <th data-column-id="PInfoCode" data-header-align="center" data-align="center" data-formatter="PInfoCode" data-order="desc">p_info_code</th>
		  <th data-column-id="PInfoName" data-header-align="center" data-align="center" data-formatter="PInfoName" data-order="desc">p_info_name</th>
		  <th data-column-id="PInfoPhoto" data-header-align="center" data-align="center" data-formatter="PInfoPhoto" data-order="desc">p_info_photo</th>
		  <th data-column-id="PInfoIdcard" data-header-align="center" data-align="center" data-formatter="PInfoIdcard" data-order="desc">p_info_idcard</th>
		  <th data-column-id="PInfoNational" data-header-align="center" data-align="center" data-formatter="PInfoNational" data-order="desc">p_info_national</th>
		  <th data-column-id="PInfoBirthday" data-header-align="center" data-align="center" data-formatter="PInfoBirthday" data-order="desc">p_info_birthday</th>
		  <th data-column-id="PInfoAge" data-header-align="center" data-align="center" data-formatter="PInfoAge" data-order="desc">p_info_age</th>
		  <th data-column-id="PInfoXingzuo" data-header-align="center" data-align="center" data-formatter="PInfoXingzuo" data-order="desc">p_info_xingzuo</th>
		  <th data-column-id="PInfoShuxiang" data-header-align="center" data-align="center" data-formatter="PInfoShuxiang" data-order="desc">p_info_shuxiang</th>
		  <th data-column-id="PInfoEdage" data-header-align="center" data-align="center" data-formatter="PInfoEdage" data-order="desc">p_info_edage</th>
		  <th data-column-id="PInfoType" data-header-align="center" data-align="center" data-formatter="PInfoType" data-order="desc">p_info_type</th>
		  <th data-column-id="PInfoLevel" data-header-align="center" data-align="center" data-formatter="PInfoLevel" data-order="desc">p_info_level</th>
		  <th data-column-id="PInfoPrice" data-header-align="center" data-align="center" data-formatter="PInfoPrice" data-order="desc">p_info_price</th>
		  <th data-column-id="PInfoState" data-header-align="center" data-align="center" data-formatter="PInfoState" data-order="desc">p_info_state</th>
		  <th data-column-id="PInfoEducation" data-header-align="center" data-align="center" data-formatter="PInfoEducation" data-order="desc">p_info_education</th>
		  <th data-column-id="PInfoMarriage" data-header-align="center" data-align="center" data-formatter="PInfoMarriage" data-order="desc">p_info_marriage</th>
		  <th data-column-id="PInfoHobby" data-header-align="center" data-align="center" data-formatter="PInfoHobby" data-order="desc">p_info_hobby</th>
		  <th data-column-id="PInfoClass" data-header-align="center" data-align="center" data-formatter="PInfoClass" data-order="desc">p_info_class</th>
		  <th data-column-id="PInfoCity" data-header-align="center" data-align="center" data-formatter="PInfoCity" data-order="desc">p_info_city</th>
		  <th data-column-id="PInfoAddress" data-header-align="center" data-align="center" data-formatter="PInfoAddress" data-order="desc">p_info_address</th>
		  <th data-column-id="PInfoCert" data-header-align="center" data-align="center" data-formatter="PInfoCert" data-order="desc">p_info_cert</th>
		  <th data-column-id="PInfoTrain" data-header-align="center" data-align="center" data-formatter="PInfoTrain" data-order="desc">p_info_train</th>
		  <th data-column-id="PInfoEdu" data-header-align="center" data-align="center" data-formatter="PInfoEdu" data-order="desc">p_info_edu</th>
		  <th data-column-id="PInfoPermanent" data-header-align="center" data-align="center" data-formatter="PInfoPermanent" data-order="desc">p_info_permanent</th>
		  <th data-column-id="PInfoReward" data-header-align="center" data-align="center" data-formatter="PInfoReward" data-order="desc">p_info_reward</th>
		  <th data-column-id="PInfoLifeimg" data-header-align="center" data-align="center" data-formatter="PInfoLifeimg" data-order="desc">p_info_lifeimg</th>
		  <th data-column-id="PInfoCertimg" data-header-align="center" data-align="center" data-formatter="PInfoCertimg" data-order="desc">p_info_certimg</th>
		  <th data-column-id="PInfoNote" data-header-align="center" data-align="center" data-formatter="PInfoNote" data-order="desc">p_info_note</th>
		  <th data-column-id="PInfoTel" data-header-align="center" data-align="center" data-formatter="PInfoTel" data-order="desc">p_info_tel</th>
		  <th data-column-id="PInfoContacter1" data-header-align="center" data-align="center" data-formatter="PInfoContacter1" data-order="desc">p_info_contacter1</th>
		  <th data-column-id="PInfoRelation1" data-header-align="center" data-align="center" data-formatter="PInfoRelation1" data-order="desc">p_info_relation1</th>
		  <th data-column-id="PInfoWorkunit1" data-header-align="center" data-align="center" data-formatter="PInfoWorkunit1" data-order="desc">p_info_workunit1</th>
		  <th data-column-id="PInfoReltel1" data-header-align="center" data-align="center" data-formatter="PInfoReltel1" data-order="desc">p_info_reltel1</th>
		  <th data-column-id="PInfoContact2" data-header-align="center" data-align="center" data-formatter="PInfoContact2" data-order="desc">p_info_contact2</th>
		  <th data-column-id="PInfoRelation2" data-header-align="center" data-align="center" data-formatter="PInfoRelation2" data-order="desc">p_info_relation2</th>
		  <th data-column-id="PInfoWorkunit2" data-header-align="center" data-align="center" data-formatter="PInfoWorkunit2" data-order="desc">p_info_workunit2</th>
		  <th data-column-id="PInfoRelTel2" data-header-align="center" data-align="center" data-formatter="PInfoRelTel2" data-order="desc">p_info_relTel2</th>
		  <th data-column-id="PInfoCreateperson" data-header-align="center" data-align="center" data-formatter="PInfoCreateperson" data-order="desc">p_info_createperson</th>
		  <th data-column-id="PInfoLastdate" data-header-align="center" data-align="center" data-formatter="PInfoLastdate" data-order="desc">p_info_lastdate</th>
		  <th data-column-id="PInfoCreatedate" data-header-align="center" data-align="center" data-formatter="PInfoCreatedate" data-order="desc">p_info_createdate</th>
 
	
		  <th data-column-id="Id" data-type="numeric" data-identifier="true" data-formatter="commands" data-sortable="false">操作</th>

 
		    </tr>
        </thead>
    </table>
</div>

</body>
</html>


